import request from '@/utils/request';

// 水质指纹库列表获取
export function getTraceabilityList (params) {
  return request({
    url: '/trace/tracefirmfinger/list',
    method: 'get',
    params
  })
}

// 水质指纹库单个删除
export function deleteTraceability (id) {
  return request({
    url: `/trace/tracefirmfinger/remove/${id}`,
    method: 'post'
  })
}



// 水质指纹库新增
export function addTraceability (data) {
  return request({
    url: '/trace/tracefirmfinger',
    method: 'post',
    data
  })
}

// 水质指纹库编辑
export function updateTraceability (data) {
  return request({
    url: '/trace/tracefirmfinger/edit',
    method: 'post',
    data
  })
}

// 水质指纹库详情
export function getTraceabilityDetail (id) {
  return request({
    url: `/trace/tracefirmfinger/${id}`,
    method: 'get'
  })
}

// 获取设备下拉接口
export function getDeviceSelect () {
  return request({
    url: '/trace/tracebaseinfo/listall',
    method: 'get',
  })
}

// 获取所属企业下拉列表
export function getEnterpriseSelect () {
  return request({
    url: '/base/pollutionsource/listall',
    method: 'get',
  })
}


//溯源仪树形结构
export function getTreeSelect () {
  return request({
    url: '/trace/tracebaseinfo/treelist',
    method: 'get',
  })
}

// 监测数据分页接口
export function getMonitorDataPage (params) {
  return request({
    url: '/trace/tracemonitoringdata/list',
    method: 'get',
    params
  })
}

// 废水污染源排放清单列表查询
export function getPollutionList (params) {
  return request({
    url: '/base/pollutionsource/list',
    method: 'get',
    params
  })
}

// 废水污染源排放清单修改
export function editPollution (data) {
  return request({
    url: '/base/pollutionsource/edit',
    method: 'post',
    data
  })
}
// 废水污染源排放清单删除
export function deletePollution (id) {
  return request({
    url: `/base/pollutionsource/remove/${id}`,
    method: 'get'
  })
}
// 废水污染源排放清单新增
export function addPollution (data) {
  return request({
    url: '/base/pollutionsource/add',
    method: 'post',
    data
  })
}


// 入河排污口与污染源企业关系列表查询
export function getAssociationList (params) {
  return request({
    url: '/base/pipenetworkassociationtable/list',
    method: 'get',
    params
  })
}

// 入河排污口与污染源企业关系修改
export function editAssociation (data) {
  return request({
    url: '/base/pipenetworkassociationtable/edit',
    method: 'post',
    data
  })
}
// 入河排污口与污染源企业关系删除
export function deleteAssociation (id) {
  return request({
    url: `/base/pipenetworkassociationtable/remove/${id}`,
    method: 'post'
  })
}
// 入河排污口与污染源企业关系新增
export function addAssociation (data) {
  return request({
    url: '/base/pipenetworkassociationtable',
    method: 'post',
    data
  })
}

// 入河排污口与污染源企业关系详情
export function getAssociationDetail (id) {
  return request({
    url: `/base/pipenetworkassociationtable/${id}`,
    method: 'get'
  })
}

//企业下拉接口获取
export function getEnterpriseOptions () {
  return request({
    url: '/base/pollutionsource/listall',
    method: 'get',
  })
}

//排污口下拉接口获取
export function getDischargeOptions () {
  return request({
    url: '/pwk/rhoutfall/listall',
    method: 'get',
  })
}


//------------------------溯源责任主体清单-------------------------

// 溯源责任主体清单列表查询
export function getResponsibilityList (params) {
  return request({
    url: '/pwk/rhoutfall/list',
    method: 'get',
    params
  })
}

// 溯源责任主体清单新增
export function addResponsibility (data) {
  return request({
    url: '/pwk/rhoutfall',
    method: 'post',
    data
  })
}

// 溯源责任主体清单修改
export function editResponsibility (data) {
  return request({
    url: '/pwk/rhoutfall/edit',
    method: 'post',
    data
  })
}

//基本信息-获取排口详情接口
export function getResponsibilityDetail (id) {
  return request({
    url: `/pwk/rhoutfall/${id}`,
    method: 'get'
  })
}

//关系拓扑图-根据排口获取污染源
export function getPollutionByOutfall (id) {
  return request({
    url: `/base/pipenetworkassociationtable/pollutionsource/${id}`,
    method: 'get'
  })
}
//关系拓扑图-根据排口获取断面信息
export function getSectionByOutfall (id) {
  return request({
    url: `/base/segmentorrhoutfall/segment/${id}`,
    method: 'get'
  })
}
//基本信息-获取排口责任主体列表
export function getResponsibilityListByOutfall (id) {
  return request({
    url: `/pwk/rhoutfallentprise/listall`,
    method: 'get',
    params: {
      outfallid: id
    }
  })
}
//关联分析-排污口与污染源关联分析
export function getOutfallPollutionRelation (params) {
  return request({
    url: `/pwk/rhoutfall/analyzepollutionsource`,
    method: 'get',
    params
  })
}
//关联分析-排口与上下游关联分析
export function getOutfallUpDownRelation (params) {
  return request({
    url: `/pwk/rhoutfall/analyzesegment`,
    method: 'get',
    params
  })
}
//关联分析-污染物下拉列表
export function getPollutionOptions () {
  return request({
    url: '/buspollutant/listall',
    method: 'get'
  })
}

// <---- 设备管理 ----->
//设备管理列表查询
export function getDeviceList (params) {
  return request({
    url: '/trace/tracebaseinfo/list',
    method: 'get',
    params
  })
}

//设备管理新增
export function addDevice (data) {
  return request({
    url: '/trace/tracebaseinfo/',
    method: 'post',
    data
  })
}

//设备管理修改
export function editDevice (data) {
  return request({
    url: '/trace/tracebaseinfo/edit',
    method: 'post',
    data
  })
}

//设备管理详情
export function getDeviceDetail (id) {
  return request({
    url: `/trace/tracebaseinfo/${id}`,
    method: 'get'
  })
}

//设备管理删除
export function deleteDevice (id) {
  return request({
    url: `/trace/tracebaseinfo/remove/${id}`,
    method: 'post'
  })
}
